<?php

require_once('inc.config.php');

$useTemplate   = 'agent_detail.html';

$section = $_REQUEST["section"];
if(!isset($section)){$section="sell";}
if($_REQUEST["s_page"]==""||!isset($_REQUEST["s_page"])){
	$_REQUEST["s_page"]=1;
}
$p = $_REQUEST["s_page"];

if($section=="sell" || $section=="rent"){
	$condition = array(
		"aid" => $_REQUEST["aid"],
		"price" => $_REQUEST["price"],
		"floor" => $_REQUEST["floor"],
		"square"  => $_REQUEST["square"],
		"isfull" => $_REQUEST["isfull"],
		"infoid"=>$_REQUEST["infoid"],
		"ispublic" => 1
	);
}else{
	$condition = array(
		"ruserid" => $_REQUEST["aid"],
		"type" => $_REQUEST["s_type"],
		"infoid" => $_REQUEST["infoid"],
		"ispublic" => 1,
		"ruserprop" => 0
	);

}

$page = new QuickSkin ($useTemplate );

template_ini($page);

$agentinfo = $myAgent->getAgentDetail($_REQUEST["aid"]);


if($section=="sell"){
	$houselist = $myHouse->getSearchSellList($condition , 1 , $p);
	$totalnum = $myHouse->getSearchNum($condition);
	$tp = ceil($totalnum/__search_shouse_num__);
	$page->assign("sellcls" , "selected");
}else if($section=="rent"){
	$houselist = $myHouse->getSearchRentList($condition , 1 , $p);
	$totalnum = $myHouse->getSearchNum2($condition);
	$tp = ceil($totalnum/__search_rhouse_num__);
	$page->assign("rentcls" , "selected");
}else if($section == "qg"){
	$result = $myQgqzhouse->getQgList($condition , 1 , $p);
	$totalnum = $myQgqzhouse->getSearchNum($condition);
	$tp = ceil($totalnum/__search_qhouse_num__);
	$page->assign("qgcls" , "selected");
}else if($section == "qz"){
	$result = $myQgqzhouse->getQgList($condition , 1 , $p);
	$totalnum = $myQgqzhouse->getSearchNum($condition);
	$tp = ceil($totalnum/__search_qhouse_num__);
	$page->assign("qzcls" , "selected");
}

$page->assign($agentinfo);
$page->assign("houselist" , $houselist);
$page->assign("total" , $totalnum);
$page->assign("totalpage" ,$tp);
$page->assign("section" , $section);
$page->assign($_REQUEST);

$page->assign("indexcls" , "nv_current");
$page->output();


ob_end_flush();

?>
